package com.example.demo.mysql.mode;

/**
 * @author lzz
 * @package com.example.zuul.templete
 * @create 2019-05-20 10:09
 * @description: ${DESCRIPTION}
 */
public enum StatusCode {
    OK(200,"成功"),
    LOGIN_OK(200,"登录成功"),
    USERINFO_OK(200,"成功获取用户信息"),

    TOKEN(401,"token错误或超时"),
    NOTOKEN(401,"没有token"),
    USERINFO_NO(402,"获取用户信息失败"),
    TOKEN_EMPTY(402,"token不存在"),

    USERNAME_PASSWORD_EMPTY(403,"账号或密码为空"),
    EMAIL_NOT_EXIST(403,"账号不存在"),
    PASSWORD_ERROR(403,"账户或密码错误"),

    ;
    private Integer code;
    private String msg;

    StatusCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }



    //枚举里面只要给get方法就可以了,因为枚举的使用都是直接用构造方法来创建,不会再从新set
    public Integer getCode() {
        return code;
    }



    public String getMsg(){
        return msg;
    }
}
